﻿// <copyright file="ErrorWindow.xaml.cs" company="Marcin Wosik">
// Copyright (c) 2010 All Right Reserved
// </copyright>
// <author>Marcin Wosik</author>
// <email>mawo11@gmail.com</email>
// <date>2010-02-25</date>
// <summary></summary>
namespace GameOfLife
{
    using System;
    using System.Windows;
    using System.Windows.Controls;

    public partial class ErrorWindow : ChildWindow
    {
        public ErrorWindow(Exception exception)
        {
            InitializeComponent();
            if (exception != null)
            {
                ErrorTextBox.Text = exception.Message + Environment.NewLine + Environment.NewLine + exception.StackTrace;
            }
        }

        public ErrorWindow(Uri uri)
        {
            InitializeComponent();
            if (uri != null)
            {
                ErrorTextBox.Text = "Page not found: \"" + uri.ToString() + "\"";
            }
        }

        public ErrorWindow(string message, string details)
        {
            InitializeComponent();
            ErrorTextBox.Text = message + Environment.NewLine + Environment.NewLine + details;
        }

        private void OKButtonClick(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
        }
    }
}